<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>MP4Player README</title></head>
<body id="top">
<h1><b>MP4Player README</b></h1>
<p>
Feb, 2003<br>
Bill May<br>
<a href="http://www.cisco.com">Cisco Systems</a>
<P>
This is the beginning of a README for mp4player that will answer
some questions on how to use mp4player. <br>
There is also a main <a href="mrm.html">README</a> for the mpeg4ip project,
as well as an <a href="pi.html">internals guide</a> to the player. 
<P>
<a href="#clarg">Command line arguments</a><br>
<a href="#configvar">Configuration Variables</a><br>
<a href="#plugin">Player Plugins</a><br>
<a href="#url">Player URLS</a><br>
<a href="#href">ISMA Href Support</a><br>
<a href="#keys">MP4Player key shortcuts</a><br>
<a href="#wgui">Windows GUI</a><br>
<a href="#pb">Known Problems</a><P>
<div id="clarg">
<H2><b>Command line arguments</b></h2> 
</div>
<P>
mp4player will take a -loop or --loop  option (to loop).  Both mp4player and 
gmp4player will take a file name/url to start playing.  As of 1.1, mp4player 
and gmp4player will take configuration variables in the command line.  Use
--&lt;variable&gt;=&lt;value&gt;, and make sure that the correct case is used.
<P>
You can display the configuration variable list by using either -c or --config-vars
<P>
That's it.
<P>
<a href="#top">Back to top</a>
<P>
<div id="configvar">
<h2><b>Configuration Variables</b></h2>
</div>
<P>
Configuration variables are stored in the windows registry for Windows
(see below), and in ~/.gmp4player_rc for every other OS.
<P>
Configuration variables are read at start, and apply to the entire
session.  Some can be changed with GUI knobs.  The latest list of 
configuration variables can be found in our_config_file.cpp.  LOG_*
defines can be found in include/systems.h
<P>
Boolean values must be 0 or 1.
<P>
Here is the current list by categories:
<P>
<table border cellpadding=5 summary="Configuration Variables">
<tbody>
<tr>
<th colspan=5 align=center><b>History List</b></th>
</tr>
</tbody>

<tbody>
<tr>
  <th>Name</th><th>Type</th><th>Default</th><th>Gui</th><th>Does</th>
</tr>
<tr align=center>
  <td>File0</td><td>String</td><td>NULL</td><td>yes</td><td>last file player</td>
</tr>
<tr align=center>
  <td>File1</td><td>String</td><td>NULL</td><td>yes</td><td>before that one</td>
</tr>
<tr align=center>
<td>File2</td><td>String</td><td>NULL</td><td>yes</td><td>before that one</td>
</tr>
<tr align=center>
<td>File3</td><td>String</td><td>NULL</td><td>yes</td><td> before that one</td>
</tr>
<tr align=center>
<td>PrevDirectory</td><td>String</td><td>NULL</td><td>yes</td><td>last directory looked at</td>
</tr>
<tr><td colspan=5 align=center><b>Playing Status</b></tr>
<tr>
  <th>Name</th><th>Type</th><th>Default</th><th>Gui</th><th>Does</th>
<tr align=center>
<td>Looped</td><td>Boolean</td><td>0</td><td>yes</td><td>loop session</td>
</tr>
<tr align=center>
<td>LogFile</td><td>String</td><td>none</td><td>yes</td><td>File to save console output</td>
</tr>
<tr><td colspan=5 align=center><b>Audio Knobs</b></tr>
<tr>
  <th>Name</th><th>Type</th><th>Default</th><th>Gui</th><th>Does</th>
<tr align=center>
<td>PlayAudio</td><td>Boolean</td><td>1</td><td>yes</td><td>Enables/Disables audio stream</td>
</tr>
<tr align=center>
<td>Volume</td><td>Integer</td><td>75</td><td>yes</td><td>volume percentage</td>
</tr>
<tr align=center>
<td>AudioMuted</td><td>Boolan</td><td>0</td><td>yes</td><td>mutes audio</td>
</tr>
<tr align=center>
<td>LimitAudioSdlBuffer</td><td>Boolean</td><td>0</td><td>no</td><td>See below</td>
</tr>
<tr><td colspan=5 align=center><b>Video Knobs</b></td></tr>
<tr>
  <th>Name</th><th>Type</th><th>Default</th><th>Gui</th><th>Does</th>
<tr align=center>
<td>PlayVideo</td><td>Boolean</td><td>1</td><td>yes</td><td>Enables/Disables video stream</td>
</tr>
<tr align=center>
<td>AspectRatio</td><td>Integer</td><td>0</td><td>yes</td><td>Sets Aspect Ratio</td>
</tr>
<tr align=center>
<td>FullScreen</td><td>Boolean</td><td>0</td><td>yes</td><td>Enable full screen on start.</td>
</tr>
<tr><td colspan=5 align=center><b>Compatibility Knobs</b></td></tr>
<tr>
  <th>Name</th><th>Type</th><th>Default</th><th>Gui</th><th>Does</th>
<tr align=center>
<td>UseOldMp4Lib</td><td>Boolean</td><td>0</td><td>yes</td><td>  Uses Quicktime library for mp4 files</td>
</tr>
<tr>
<td colspan=5 align=center><b>Streaming Knobs</b></td></tr>
<tr>
  <th>Name</th><th>Type</th><th>Default</th><th>Gui</th><th>Does</th>
<tr align=center>
<td>RtpBufferTimeMsec</td><td>Integer</td><td>2000</td><td>no</td><td>Sets time of initial RTP buffering.</td>
</tr>
<tr align=center>
<td>MulticastIf</td><td>String</td><td></td><td>no </td><td>Sets the interface to use for multicast receive</td>
</tr>
<tr align=center>
<td>RxSocketSize</td><td>Integer</td><td>0</td><td>no </td><td>Set the receive buffer size (0 use default)</td>
</tr>
<tr align=center>
<td>RtpIpPortMin</td><td>Integer</td><td>-1</td><td>no </td><td>Sets local ip port to start with in RTSP session</td>
</tr>
<tr align=center>
<td>RtpIpPortMax</td><td>Integer</td><td>-1</td><td>no</td><td>Sets local ip port to end with in RTSP session</td>
</tr>
<tr align=center>
<td>UseRtpOverRtsp</td><td>Boolean</td><td>0</td><td>yes</td><td>Use RTP over RTSP (rfc 2326, section 10.2)</td>
</tr>
<tr align=center>
<td>SendRtcpInRtpOverRtsp</td><td> Boolean</td><td>0</td><td>no</td><td>Enables sending of RTCP msgs to server when using RTP over RTSP (If enabled, can crash DSS).</td>
</tr>
<tr align=center>
<td>Mpeg2tPamWaitSecs</td><td>Integer</td><td>30</td><td>no</td><td>Sets time to wait for PAM in Mpeg2 transport session</td>
</tr>
<tr align=center>
<td>UrlExec</td><td>String</td><td>NULL</td><td>no</td><td>path to executable for Href url dispatch (not in Windows))</td>
</tr>
<tr><td colspan=5 align=center><b>Debugging Knobs</b></td></tr>
<tr>
  <th>Name</th><th>Type</th><th>Default</th><th>Gui</th><th>Does</th>
<tr align=center>
<td>HttpDebug</td><td>Integer</td><td>LOG_ALERT</td><td>yes</td><td>Sets Http library debug level</td>
</tr>
<tr align=center>
<td>RtspDebug</td><td>Integer</td><td>LOG_ALERT</td><td>yes</td><td>Sets RTSP library debug level</td>
</tr>
<tr align=center>
<td>SdpDebug</td><td>Integer</td><td>LOG_ALERT</td><td> yes</td><td>Sets SDP library debug level</td>
</tr>
<tr align=center>
<td>RtpDebug</td><td>Integer</td><td>LOG_ALERT</td><td>yes</td><td>Sets RTP library debug level</td>
</tr>
<tr align=center>
<td>Mpeg2tDebug</td><td>Integer</td><td>LOG_ALERT</td><td>yes</td><td>Sets Mpeg2t library debug level</td>
</tr>
<tr align=center>
<td>Mpeg2psDebug</td><td>Integer</td><td>LOG_ALERT</td><td>yes</td><td>Sets Mpeg2ps library debug level</td>
</tr>
<tr align=center>
<td>DisplayDebug</td><td>boolean</td><td>0</td><td>yes</td><td>Display status every second (gmp4player only)</td>
</tr>
<tr><td colspan=5 align=center><b>Plugin Knobs</b></td></tr>
<tr>
  <th>Name</th><th>Type</th><th>Default</th><th>Gui</th><th>Does</th>
<tr align=center>
<td>Mpeg4IsoOnly</td><td>Boolean</td><td>0</td><td>yes</td><td>Forces ISO decoder over Xvid</td>
</tr>
<tr align=center>
<td>UseFFmpeg</td><td>Boolean</td><td>0</td><td>no</td><td>Forces use of FFmpeg video decoder</td>
</tr>
<tr align=center>
<td>UseFFmpegAudio</td><td>Boolean</td><td>0</td><td>no</td><td>Forces use of FFmpeg audio decoder</td>
</tr>
</table>
<P>
<a href="#top">Back to top</a>
<P>
<div id="plugin">
<h2><b>Player Plugins</b></h2>
</div>
<P>
Starting with version 0.9.3.2, we've gone to a plugin model for audio
and video codecs for the player.  This is true for both windows and
linux platforms.  As of 0.9.7, we also have plugins available for 
RTP byte streams.  Release 1.3 adds text type plugins.
<P>
On linux (and linux like) platforms, the plugins should be in the 
mp4player_plugin directory, which is a sub directory of where the
other mpeg4ip libraries will be stored.  You must do a make install
of the plugin when running/debugging with plugins - the player does
not currently search for plugins.  When installing a new version of
the plugins, it is a good idea to purge this directory.
<P>
On Windows, the .dlls that get created must be in the same directory as 
the executable for mp4player.exe or wmp4client.exe.  The project files
should copy the plugin DLLs to the player/src directory, so when 
running the player, it should work fine.
<P>
The plugin pattern can be found in player/src/codec_plugin.h and in player/src/rtp_plugin.h.  
Both plugins contain a version number to enable detection of API changes.
<P>
<a href="#top">Back to top</a>
<P>
<div id="url">
<h2><b>Player URLS</b></h2>
</div>
<P>

We have 2 special type URLs for the player to play content.  The first
one is for mpeg2 transport streams.  To play an mpeg2 transport stream
over UDP, use the following url:
<P>
mpeg2t://&lt;multicast address&gt;:&lt;multicast port&gt;
<P>
The 2nd special URL is to play a stream from a Cisco IP/TV server, either
broadcast or on demand.  To do this, use the following url:
<P>
iptv://&lt;iptv content manager&gt;/&lt;program id&gt;
<P>
Where iptv content manager is the address of the IP/TV content manager, and
program id is the session id that is created. You can find this out by
looking at the program on the content manager, or get the session id by
running the iptv_prog utility with the content manager as a parameter.
<P>
<a href="#top">Back to top</a>
<P>
<div id="href">
<h2><b>ISMA Href Support</b></h2>
</div>
<P>
In release 1.3, we implemented support for ISMA href.  This is a method
that allows timed opening of web pages to synchronize with audio and
video.
<p>
There are 2 methods that can be used; automatically dispatching URLs, or
click to dispatch.  Normally, the cursor will be off in the video window
while the video is running.  Click to dispatch will enable the cursor in 
the window while active.
<p>
While using this feature, the browser should be set to open new urls
in the existing window.  In Firefox, this setting is in Preferences->Advanced->Tabbed Browsing.  Make sure "Open Links From Other Applications" is set
to "the most recent tab/window".
<p>
On Windows, the default browser will be used.  On Mac OS X, the
"open" command is used (which should use the default browser).  On
Linux, /usr/bin/firefox/firefox is tried.  The browser in question
can be set up by using the UrlExec configuration file setting; the
full path to the browser should be used.
<p>
On Linux, Konquerer web browser can not be used, as it will open
a different process for each url.
<p>
On Mac OS X, Safari should be avoided; there is no setting to open
URLs in the same window, only in a new window or new tab.
<p>

<div id="keys">
<h2><b>MP4Player key shortcuts</b></h2>
</div>
<P>
If you are using mp4player (or gmp4player), the following key short cuts can be used, 
assuming you've got a video window:
<P>
<table summary="mp4player key shortcuts">
<tr><td>HOME </td> <td>begin video from beginning</td></tr>
<tr><td>PAGE UP </td> <td>increase video size (200% max)</td></tr>
<tr><td>PAGE DOWN </td> <td>decrease video size (50% min)</td></tr>
<tr><td>ALT-ENTER </td> <td>fullscreen</td></tr>
<tr><td>ESC </td> <td>return from fullscreen</td></tr>
<tr><td>LEFT ARROW </td> <td>go back 10 seconds</td></tr>
<tr><td>RIGHT ARROW </td> <td>go forward 10 seconds</td></tr>
<tr><td>UP ARROW </td> <td>volume up 1/10th</td></tr>
<tr><td>DOWN ARROW </td> <td>volume down 1/10th</td></tr>
<tr><td>SPACE </td> <td>pause or continue</td></tr>
<tr><td>CTRL-C </td> <td>close video (mp4player - advance to next playlist)</td></tr>
<tr><td>CTRL-X </td> <td>close mp4player</td></tr>
<tr><td>CTRL-0 </td> <td>Default Aspect Ratio</td></tr>
<tr><td>CTRL-1 </td> <td>Aspect Ratio of 3:4</td></tr>
<tr><td>CTRL-2 </td> <td>Aspect Ratio of 16:9</td></tr>
<tr><td>CTRL-3 </td> <td>Aspect Ratio of 1.85 Letterbox</td></tr>
<tr><td>CTRL-4 </td> <td>Aspect Ratio of 2.35 Letterbox</td></tr>
<tr><td>CTRL-5 </td> <td>Aspect Ratio of 1:1</td></tr>
<tr><td>CTRL-S </td><td>Seek dialog (gmp4player only)</td></tr>
<tr><td>CTRL-N </td><td>Next item in playlist (gmp4player only)</td></tr>
</table>
<P>
<a href="#top">Back to top</a>
<P>
<div id="wgui">
<h2><b>Windows GUI</b></h2>
</div>
<P>
First - if you're the type of person who wants the player to work
with a nice interface, this isn't the place for you.  Go see Quicktime
or Envivio players.
<P>
We've created a simple windows GUI.  It consists of 2 parts - 
wmp4player and wmp4client.  wmp4player contains the GUI, and 
wmp4client is basically mp4player that will communicate with
wmp4player.
<P>
wmp4client is launched as a seperate process, due to SDL limitations.
The 2 processes communicate using file maps in memory.  See the CMp4Process
and CMP4If classes in wmp4player and CClientProcess in wmp4client.
<P>
To create this, look for the player60.dsw in player/src directory. This
will make all 3 executables (mp4player, wmp4player.exe and wmp4client.exe,
as well as all the plugins).
<P>
To install wmp4player, put the <b>Release version</b> (ie: versions from
the Release folder) of wmp4player.exe, wmp4client.exe and
SDL.dll in the same directory.  We will not be writing any installers.
In addition, make sure <b>all</b> desired plugins are in the same directory.
<P>
These programs will use the registry for storing information that
Linux stores in .gmp4player_rc.  Look for the Software\Mpeg4ip\Config
registry entry.  Our config file library is rigged to save this data
there.  mp4player will still use a gmp4player_rc file.
<P>
At this time, if it's broken, you're going to have to fix it.  The
same goes with GUI "nits" - we're not GUI writers.  Currently, there is
no playlist support, no loop support, no drag and drop support, no
wmp4player command line support, no accelerator from the dialog 
window (accelerators from the video window still work).
<P>
<a href="#top">Back to top</a>
<P>
<div id="pb">
<h2><b>Known Problems</b></h2>
</div>
<p>
<ul>
  <li> If you're playing through a NAT box, you may have to specify the
  default client IP ports.  Use the command <code>RtpIpPortMin=&lt;port&gt;</code> and
  <code>RtpIpPortMax=&lt;port&gt;</code> in the .gmp4player_rc file created in your home
  directory.  The IETF recommends a range of 6970 to 6999.

<P>
  <li> The player for windows is sketchy at best.  We have included project
  files that should build for Dev Studio 6.0.  We recommend installing 
  DirectX 8.1 or later.  If that is not possible, and you have problems 
  with video, try uncommenting out <code>#define OLD_SURFACE</code>
 in player/src/video.cpp.
<P>
  If you have problems with choppy playback, and you're using Windows 98, 
  forget about it.  The timer tick time is too slow (55 msec) for us to
  use effectively.  Try Quicktime or Real with Envivio, or update to a
  newer Windows OS.
<P>
  <li> FreeBSD based OS's have a problem with thread delays.  This can 
  cause the player to skip rendering many frames.  If you have this
  problem update to the latest version of FreeBSD - the problem still
  can occur, but is reduced. 
<P>
  This is due to an error in the thread scheduling code that causes a problem
  with a delay of less than the thread scheduler quantum (200 msec in
  some versions, 20 in others).  Since the average delay used is 9
  to 10 msec (less as we get closer to the video rendering time), this
  can have a great effect on video playback.
 <P> 
  You can get around this error by rebuilding your libc, after changing the
  <code>THREAD_SCHED_USECS</code> to 20000 (or lower) from 200000 in thread_private.h.
<P>
  <li> If you're running on Linux, and trying to play a raw audio file, and 
  notice that you get garbage, try setting the <code>LimitAudioSdlBuffer</code> config
  variable to 1 in the .gmp4player_rc file.  This seems to occur on a 
  Soundblaster Live, Red Hat 7.3 machine.
</ul>
<P>
<a href="#top">Back to top</a>
<P>
=== END OF README ===
<p>
<a href="http://validator.w3.org/check/referer"><img
   src="http://www.w3.org/Icons/valid-html401"
   alt="Valid HTML 4.01!" height="31" width="88"></a>
 </p>

</body>
</html>
